package top.royaltownserver.util;

/**
 * projectName: top.royaltownserver.util
 *
 * @author: Aiolin
 * description:
 * time: 2025/5/14 上午10:12
 */

import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Properties;
import java.io.Reader;


public class ConfigLoader {

    public static Properties loadConfig() throws Exception {
        Properties props = new Properties();
        String configPath = System.getProperty("config.path", "config.properties");

        try (Reader reader  = new InputStreamReader(new FileInputStream(configPath), StandardCharsets.UTF_8)) {
            props.load(reader);
        }

        return props;
    }
}
